<?php

if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Helper file: util_helper
 *
 * @author nhchung
 * @since 20-04-2013
 */
if (!function_exists('get_media_url')) :

function get_media_url($media_uri)
{
	$ci =& get_instance();
	$ci->config->load('acx');
	list($object_id, $media_id) = explode("@", $media_uri);
	$media_server = $ci->config->item('media_server');
	return $media_server['get_url'][$media_id] . $object_id;
}

endif;


if (!function_exists('get_ajax_call_options')) :

function get_ajax_call_options($key)
{
	$ci =& get_instance();
	$ci->config->load('acx');
	$options = $ci->config->item('ajaxCallOptions');
	if(isset($options[$key])){
	 	return $options[$key];
	}else{
		return NULL;
	}
}

endif;